function ranking(){
	var oarr = [];
	var obj = {};
	var xhr = new XMLHttpRequest();
	var domian = "https://www.easy-mock.com/mock/5aa77cc32b0894377fc76657";
	xhr.open("GET", domian + "/paihang");
	xhr.send();
	xhr.addEventListener("readystatechange", function() {
		var get_som = document.querySelector(".ranking_l_wrap");
		if(xhr.status == 200 && xhr.readyState == 4) {
//			console.log(xhr.response)
			obj = JSON.parse(xhr.response);
			oarr = obj.topList;
//			console.log(oarr);
		}
		var temp = '';
		oarr.forEach(function(el, index) {
			var li = document.createElement("li");
			li.classList.add("topic_item");
			temp = `<div class="topic_main">
			            <a href="javascript:;" class="topic_media">
			                
			                <img src='${oarr[index].picUrl}'>
			                <span class="listen_count"><i class="iconfont icon-erji"></i>${num(el.listenCount)}万</span>
			            </a>
			            <div class="topic_info">
			                <div class="topic_cont">
			                    <h3 class="topic_tit">${oarr[index].topTitle}</h3>
			                    ${topic(el.songList)}
			                </div>
			                <i class="topic_arrow"></i>
			            </div>
			        </div>`;
			        li.innerHTML = temp;
			        get_som.appendChild(li)
		})
		function topic(list){
			var temp = '';
			list.forEach(function(el,index){
				temp += `<p>${index+1}<span class="text_name">${list[index].songname}</span>- ${list[index].singername}</p>`;
			})
			return temp;
		}
		function num(list){
		var nums = Math.round(parseFloat(list)/10000)
		return nums.toFixed(1)
	}
	})
}ranking()
